const moment = require('moment');
function dateFormat(date) {
    let now = new Date(date);
    y = now.getFullYear();
    m = now.getMonth() + 1;
    d = now.getDate();
    h = now.getHours();
    m = now.getMinutes();
    s = now.getSeconds();

    return `${y}:${addZero(m)}:${addZero(d)}--${addZero(h)}:${addZero(m)}:${addZero(s)}`
}

function addZero(num) {
    // return num.toString().padStart(2, '0')
    return num < 10 ? '0' + num : num
}

module.exports = {
    dateFormat
}

const now = moment();
console.log(now.format());